$(function () {
    $('#logout').click(function () {
        message_confirm('提示','确认是否退出当前用户？',
            function (result) {
                if (result) {
                    $("#pwd").val("");
                    $('#dialogConfirmPwd').modal('show');
                    return;
                }
            });
    });
    $('#exit').click(function () {
        if ($('#pwd').val() == null || $('#pwd').val() == '') {
            message_alert('提示','请输入确认密码！',null);
        } else {
            var pwd = $('#pwd').val();
            var url = "logout?password=" + pwd;
//                location.href = url;
            $.post(url, function (result) {
                if (result == "SUCCESS") {
                    location.href = "/GMS/";
                } else {
                    message_alert('提示','密码不正确',null);
                }
            })
        }
    })

    var url = "logout?password=" + pwd;
    setInterval("getTime()", 1000);
});
function getTime() {
    $.post("getTime", function (result) {
        if (result != null) {
            //alert(result);
            $("#showDate").html(result);
        } else {
            message_alert('错误','访问服务器失败',null);
        }
    })
}

